
import { useTranslation } from "react-i18next"
import { Select } from 'antd';
import { useNavigate } from "react-router-dom";
function Index() {
    const nav=useNavigate()
    const { t,i18n } = useTranslation()
    const ss=(value:string)=>{
  i18n.changeLanguage(value)
    }
  return (
    <div style={{backgroundColor:'white',width:'500px',height:'500px'}}>
        <button onClick={()=>nav('/index/dd')}>点击切换背景颜色</button>
        多维数据分析
        <Select
    showSearch onChange={ss}
    style={{ width: 200 }}
    placeholder="切换语言"
    optionFilterProp="label"
    filterSort={(optionA, optionB) =>
      (optionA?.label ?? '').toLowerCase().localeCompare((optionB?.label ?? '').toLowerCase())
    }
    options={[
      {
        value: 'en',
        label: '英文',
      },
      {
        value: 'zh',
        label: '中文',
      },
   
    ]}
  />
      <h1>{t('Welcome to React')}</h1>
    </div>
  )
}

export default Index
